<script>
let getLineChartOption = function(legendData, xAxisData, seriesData) {
  let series = new Array();
  const legendLength = legendData.length;
  for (let i = 0; i < legendLength; i++) {
    let seriesOption = {};
    seriesOption.name = legendData[i];
    seriesOption.type = 'line';
    seriesOption.data = seriesData[i];
    series.push(seriesOption)
  }
  let option = {
    tooltip: {
      trigger: "axis"
    },
    legend: {
      data: legendData
    },
    grid: {
      left: "1%",
      right: "1%",
      bottom: "3%",
      containLabel: true
    },

    xAxis: {
      type: "category",
      boundaryGap: false,
      data: xAxisData
    },
    yAxis: {
      type: "value"
    },
    series: series
  };
  return option;
};
export default {
  getLineChartOption
};
</script>
